package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.dto.ReplyDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动问题的回答或评论 前端控制器
 * </p>
 *
 * @author 东哥
 * @since 2024-08-25
 */
@Api(tags = "用户端 - 回答 涉及接口")
@Slf4j
@RestController
@RequestMapping("/replies")
public class InteractionReplyController {




    @Autowired
    private IInteractionReplyService interactionReplyService;
    /**
     * 分页查询【回答】或【评论】列表
     */
    @ApiOperation("分页查询【回答】或【评论】列表")
    @GetMapping("/page")
    public PageDTO<ReplyVO> pageQuery( ReplyPageQuery query){
        return interactionReplyService.pageQuery(query,true);
    }
    /**新增回答评论
     * */
    @ApiOperation("新增回答评论")
    @PostMapping
    public void saveReply(@RequestBody ReplyDTO reply){
        interactionReplyService.saveReply(reply);
    }
}
